#include "Clock.h"

NAMESPACE_BEGIN
void Clock::setFrequency(const double& frequency)
{
	if (frequency <= 0.0l)
	{
		ENS_LOG___ERROR("The clock frequency cannot be less than or equal to 0.");
		return;
	}
	this->frequency = frequency;
}

double Clock::getFrequency() const
{
	return this->frequency;
}

double Clock::getCurTime() const
{
	return this->cur_time;
}

void Clock::tick()
{
	this->cur_time = this->cur_time + (1.0l / this->frequency);
}
NAMESPACE_END

